package com.zero.yygh.hosp.repository;

import com.zero.yygh.model.hosp.Hospital;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zero
 * @desc mongo配置 Repository
 * @create 2021/3/26
 */
@Repository
public interface HospitalRepository extends MongoRepository<Hospital, String> {

    /**
     * 根据医院编码获取医院
     * @author zero
     * @date 2021/3/27 12:25
     * @param hoscode 医院编码
     * @return com.zero.yygh.model.hosp.Hospital
     */
    Hospital getHospitalByHoscode(String hoscode);

    /**
     * 根据id查看医院详情
     * @author zero
     * @date 2021/3/29 16:25
     * @param id id
     * @return com.zero.yygh.model.hosp.Hospital
     */
    Hospital getHospitalById (String id);

    /**
     * 根据医院名称模糊查询
     * @author zero
     * @date 2021/3/30 17:03
     * @param hosname 医院名称
     * @return java.util.List<com.zero.yygh.model.hosp.Hospital>
     */
    List<Hospital> findHospitalByHosnameLike (String hosname);
}
